// class A{
//     public Object[] objects= new Object[100];
//     public Object getPos(int pos){
//         return this.objects[pos];
//     }
//     public void setPos(int pos,Object a){
//         this.objects[pos] = a;
//     }
// }
class A <T>{//<T>表示占位符号
    public T[] objects= (T[])new Object[100];
    public T getPos(int pos){
        return (T)this.objects[pos];
    }
    public void setPos(int pos,T a){
        this.objects[pos] = a;
    }
}
public class test1 {
    public static void main(String[] args) {
        A<Integer> a1 = new A<>();
        a1.setPos(0, 1);
        a1.setPos(1, 10);
        int b = a1.getPos(0);
        int c = a1.getPos(1);
        System.out.println(b);
        System.out.println(c);
        System.out.println("================");
        A<String> a2 = new A<>();
        a2.setPos(0, "abc");
        a2.setPos(1,"bcd");
        String d = a2.getPos(0);
        String e = a2.getPos(1);
        System.out.println(d);
        System.out.println(e);
    }
}
